package by.gravity.pvh.utils;


public class StringUtil {

	private static final String NUMBER_THOUSAND_PATTERN = "\\B(?=(?:\\d{3})+(?!\\d))";

	public static boolean isEmpty(String string) {

		if (string == null || string.length() == 0) {
			return true;
		}

		return false;
	}

	public static String convertNumberToHumanFriednly(String number) {

		if (isEmpty(number)) {
			return null;
		}
		return number.replaceAll(NUMBER_THOUSAND_PATTERN, " ");

	}

	public static String uppercaseFirstLetter(String text) {

		return Character.toUpperCase(text.charAt(0)) + text.substring(1);
	}

}
